package com.heima.fallback;

import com.heima.client.TradeClient;
import com.hmall.common.exception.BizIllegalException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

@Slf4j
public class TradeClientFallback implements FallbackFactory<TradeClient> {


    @Override
    public TradeClient create(Throwable cause) {
        return new TradeClient() {
            @Override
            public void markOrderPaySuccess(Long orderId) {
                log.error("远程调用TradeClient#updateOrderStatus方法出现异常，参数：{},", orderId);
                // 订单状态更新允许失败，修改失败，抛出异常
            }
        };
    }
}
